<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
        <link href="CSS/Style.css" rel="stylesheet" type="text/css" />
    <h:body>
        <ui:composition template="./HomeTemp.xhtml">
            <ui:define name="listevent">
                <div style="margin-left: 200px">
                    <h:form>
                        <div style="margin: 0 auto">
                            <table style="margin: 0 auto; width: 95%;">
                            <tr>
                                <td colspan="2" style="font-size: 21px; font-style: bold; text-align: center; background: activecaption"  class="mauchu"> Register </td>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">UserName: </td>
                                <td><p:inputText id="uName" value="#{registerBean.registerEntities.userName}" required="true" requiredMessage="You must input username!"></p:inputText></td>
                                <p:message id="uNameMessage" for="uName" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Name: </td>
                                <td><p:inputText id="uFullName" value="#{registerBean.registerEntities.registerName}" required="true" requiredMessage="You must FullName!"></p:inputText></td>
                                <p:message id="uFullNameMessage" for="uFullName" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Email: </td>
                                <td><p:inputText id="uEmail" value="#{registerBean.registerEntities.email}" required="true" requiredMessage="You must input email address!"></p:inputText></td>
                                <p:message id="uEmailNameMessage" for="uEmail" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Phone: </td>
                                <td><p:inputText id="uPhone" value="#{registerBean.registerEntities.phone}" required="true" requiredMessage="You must input Phone!"></p:inputText></td>
                                <p:message id="uPhoneNameMessage" for="uPhone" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Gender: </td>
                                <td><p:selectOneMenu value="#{registerBean.registerEntities.gender}" required="true" >
                                        <f:selectItem itemLabel="Male" itemValue="1" ></f:selectItem>
                                        <f:selectItem itemLabel="Female" itemValue="2" ></f:selectItem>
                                        <f:selectItem itemLabel="Other" itemValue="3" ></f:selectItem>
                                    </p:selectOneMenu></td>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Image: </td>
                                <td>
                                    <p:messages showDetail="true"/> 
                                    <p:fileUpload id="uImage" value="#{registerBean.registerEntities.images}" mode="simple" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" sizeLimit="900000"  requiredMessage="You must input Image!">
                                    
                                    </p:fileUpload>
                                    <p:message id="uImageNameMessage" for="uImage" display="text" showDetail="true"/>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right; padding: 12px" class="mauchu">Address: </td>
                                <td><p:inputText id="uAddress" value="#{registerBean.registerEntities.address}" required="true" requiredMessage="You must input address!"></p:inputText></td>
                                <p:message id="uAddressNameMessage" for="uAddress" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <h:commandButton value="Register" action="#{registerBean.updateEvent()}" ></h:commandButton>
                                </td>
                            </tr>
                        </table>
                        </div>
                    </h:form>
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
